/*
 * ChessGame.h
 *
 *  Created on: Mar 8, 2011
 *      Author: Michael Ziminsky
 */

#ifndef CHESSGAME_H_
#define CHESSGAME_H_

#include "view/chessgui.h"
#include "model/Location.h"
#include "model/ChessBoard.h"
#include "Typesfwd.h"
#include "movepiece.h"

class ChessGame
{
    static const std::string startBoard;
    model::ChessBoard gameBoard;
    view::ChessGUI gui;

    bool validatePiece(const globals::cPiece&);
public:

    ChessGame();

    const model::ChessBoard& getBoard() const;

    bool addPiece(const model::Location&, const globals::cPiece);

    bool attemptMove(MovePiece&);

    globals::moveSet getValidMoves(const globals::cPiece&, model::ChessBoard* = 0) const;

    void newGame();

    bool inCheck(bool, const model::ChessBoard* = 0) const;

    bool inCheckMate(bool, model::ChessBoard* = 0) const;

    void showGUI(bool);

    bool isLightTurn() const;
};

#endif /* CHESSGAME_H_ */
